package com.lx.entity;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author c先生
 * @date 2022年05月05日 下午 3:58:42
 * @describe
 */

public class User {
    private Integer userId;
    private String userName;
    private String userPwd;
    private Integer userStatus;
    private String userPhone;
    private String userAddress;
    private Integer userLevel;
    private Date userBirthday;
    private String userGender;
    private Date openAccount;
    private String idCard;

    public User() {
    }

    public User(String userName, String userPwd, Integer userStatus, String userPhone, String userAddress, Integer userLevel, Date userBirthday, String userGender, Date openAccount, String idCard) {
        this.userName = userName;
        this.userPwd = userPwd;
        this.userStatus = userStatus;
        this.userPhone = userPhone;
        this.userAddress = userAddress;
        this.userLevel = userLevel;
        this.userBirthday = userBirthday;
        this.userGender = userGender;
        this.openAccount = openAccount;
        this.idCard = idCard;
    }

    public User(Integer userId, String userName, String userPwd, Integer userStatus, String userPhone, String userAddress, Integer userLevel, Date userBirthday, String userGender, Date openAccount, String idCard) {
        this.userId = userId;
        this.userName = userName;
        this.userPwd = userPwd;
        this.userStatus = userStatus;
        this.userPhone = userPhone;
        this.userAddress = userAddress;
        this.userLevel = userLevel;
        this.userBirthday = userBirthday;
        this.userGender = userGender;
        this.openAccount = openAccount;
        this.idCard = idCard;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserPwd() {
        return userPwd;
    }

    public void setUserPwd(String userPwd) {
        this.userPwd = userPwd;
    }

    public Integer getUserStatus() {
        return userStatus;
    }

    public void setUserStatus(Integer userStatus) {
        this.userStatus = userStatus;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getUserAddress() {
        return userAddress;
    }

    public void setUserAddress(String userAddress) {
        this.userAddress = userAddress;
    }

    public Integer getUserLevel() {
        return userLevel;
    }

    public void setUserLevel(Integer userLevel) {
        this.userLevel = userLevel;
    }

    public Date getUserBirthday() {
        return userBirthday;
    }

    public void setUserBirthday(Date userBirthday) {
        this.userBirthday = userBirthday;
    }

    public String getUserGender() {
        return userGender;
    }

    public void setUserGender(String userGender) {
        this.userGender = userGender;
    }

    public Date getOpenAccount() {
        return openAccount;
    }

    public void setOpenAccount(Date openAccount) {
        this.openAccount = openAccount;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    private String printStatus() {
        switch (userStatus) {
            case 0:
                return "账号正常";
            case 1:
                return "账号冻结";
            case 2:
                return "账号已注销";
            default:
                return null;
        }
    }

    @Override
    public String toString() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return "用户ID:" + userId +
                "  用户名:" + userName +
                "  用户密码:" + userPwd +
                "  用户账号状态:" + this.printStatus() +
                "  用户手机号:" + userPhone +
                "  用户地址:" + userAddress +
                "  用户等级:" + userLevel +
                "  用户生日:" + sdf.format(userBirthday) +
                "  用户性别:" + userGender +
                "  开户时间:" + sdf.format(openAccount) +
                "  身份证号:" + idCard;
    }
}
